﻿<%@ Page Language="C#" MasterPageFile="~/JOINT/MstPage_JOINT.master" AutoEventWireup="true"
    EnableEventValidation="false" ValidateRequest="false" CodeFile="frmJ_StaffWorkedCompInput.aspx.cs"
    Inherits="JOINT_frmJ_StaffWorkedCompInput" Title="会社履歴情報登録" Culture="ja-JP" UICulture="ja" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    会社履歴情報登録
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <link href="../Style/JsStyle.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery.min.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript" src="../js/Validation.js"></script>

    <script language="javascript" type="text/javascript" src="../js/jquery.maskedinput.js"></script>

    <script type="text/javascript">


        // kiem tra ngay thang khong duoc lon hon ngay thang hien tai.
        function validatDate2(oSrc, args)// kiem tra ngay thang hien tai.
        {
            args.IsValid = checkYearOld(args.Value, getNowDate(new Date()), 0, "<");
        }

        // kiem tra ngay thang lam viec tai cong ty 
        // phai lon hon ngay sinh cua nhan vien
        function validatDate3(oSrc, args) {
            var date_start = $("#<%= hfNgaySinh.ClientID %>").val();
            if (date_start != "") {
                args.IsValid = checkYearOld(date_start, args.Value, 0, "<");
            } 
        }


        function checkDateIsValid(oSrc, args) {
            var date_start = "";
            date_start = $('#<%= txt_開始年月日.ClientID %>').val();
            args.IsValid = checkYearOld(date_start, args.Value, 0, "<");
        }

        function Check2Valid(source, args) {
            if (args.Value != "") {
                ValidatorEnable2(document.getElementById("<%= CustomValidator1.ClientID %>"), true);
            }
        }
    </script>

    <script type="text/javascript">
        $(document).ready(function(e) {
            registerEnterEvent("enter", "<%= btn_登録.ClientID %>", 6);
            registerControlToValidation("validation");
            formatDate("css_text_calender", "/");

        });

        
    </script>

    <div class="maindiv1">
        <div class="Header1">
            <span>＊: 必須</span>
        </div>
        <div>
            &nbsp;</div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">会社名 :</span>
            <asp:TextBox ID="txt_会社名" runat="server" Font-Names="MS UI Gothic" ValidationGroup="detailForm" 
                MaxLength="100" CssClass="enter validation textbox width3"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="None"
                SetFocusOnError="False" ErrorMessage="" ControlToValidate="txt_会社名"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server"
                Width="260px" TargetControlID="RequiredFieldValidator1" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">部門名 :</span>
            <asp:TextBox ID="txt_部門名" runat="server" Font-Names="MS UI Gothic" ValidationGroup="detailForm"
                MaxLength="100" CssClass="enter validation textbox width3"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="None"
                SetFocusOnError="False" ErrorMessage="" ControlToValidate="txt_部門名"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server"
                Width="260px" TargetControlID="RequiredFieldValidator2" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">仕事内容 :</span>
            <asp:TextBox ID="txt_仕事内容" runat="server" Font-Names="MS UI Gothic" ValidationGroup="detailForm" 
                MaxLength="1000" CssClass="enter validation textbox width3"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" Display="None"
                SetFocusOnError="False" ErrorMessage="" ControlToValidate="txt_仕事内容"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server"
                Width="260px" TargetControlID="RequiredFieldValidator3" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">主な実績 :</span>
            <asp:TextBox ID="txt_主な実績" runat="server" Font-Names="MS UI Gothic" ValidationGroup="detailForm" 
                MaxLength="500" CssClass="enter validation textbox width3"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" Display="None"
                SetFocusOnError="False" ErrorMessage="" ControlToValidate="txt_主な実績"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server"
                Width="260px" TargetControlID="RequiredFieldValidator4" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">開始年月日 :</span>
            <asp:TextBox ID="txt_開始年月日" runat="server" ValidationGroup="detailForm"  Font-Names="MS UI Gothic"
                Style="ime-mode: disabled" CssClass="enter validation css_text_calender textbox width_calendar "></asp:TextBox>
            <asp:ImageButton ID="imb_開始年月日" runat="server" Height="19px" CssClass="cal_Img" ImageUrl="~/Images/calendar.jpg"
                CausesValidation="False" ValidationGroup="abc" />
            <span class="required-field">*</span>
            <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" PopupButtonID="imb_開始年月日"
                TargetControlID="txt_開始年月日" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            <asp:RequiredFieldValidator ID="CustomValidator2" runat="server" Display="None" ErrorMessage=""
                ControlToValidate="txt_開始年月日" SetFocusOnError="False"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender8" runat="server"
                Width="260px" TargetControlID="CustomValidator2" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="CustomValidator"
                Display="None" SetFocusOnError="false" ClientValidationFunction="isDate" ControlToValidate="txt_開始年月日"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server"
                Width="240px" TargetControlID="RegularExpressionValidator1" HighlightCssClass="invalid1"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="CustomValidator4" runat="server" ErrorMessage="" ControlToValidate="txt_開始年月日"
                SetFocusOnError="False" ClientValidationFunction="validatDate2" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender9" runat="server"
                Width="260px" TargetControlID="CustomValidator4" HighlightCssClass="invalid2"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="CustomValidator6" runat="server" ErrorMessage="" ControlToValidate="txt_開始年月日"
                SetFocusOnError="False" ClientValidationFunction="validatDate3" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender11" runat="server"
                Width="260px" TargetControlID="CustomValidator6" HighlightCssClass="invalid2"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="CustomValidator5" runat="server" ErrorMessage="" ControlToValidate="txt_開始年月日"
                SetFocusOnError="False" ClientValidationFunction="Check2Valid" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender10" runat="server"
                Width="260px" TargetControlID="CustomValidator5" HighlightCssClass="invalid3"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">終了年月日 :</span>
            <asp:TextBox ID="txt_終了年月日" runat="server" ValidationGroup="detailForm" 
                Style="ime-mode: disabled" CssClass="enter validation css_text_calender textbox width_calendar" Font-Names="MS UI Gothic"></asp:TextBox>
            <asp:ImageButton ID="imb_終了年月日" runat="server" Height="19px" CssClass="cal_Img" ImageUrl="~/Images/calendar.jpg"
                CausesValidation="False" ValidationGroup="abc" />
            <span class="required-field">*</span>
            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="imb_終了年月日"
                TargetControlID="txt_終了年月日" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            <asp:RequiredFieldValidator ID="CustomValidator3" runat="server" Display="None" SetFocusOnError="False"
                ErrorMessage="" ControlToValidate="txt_終了年月日"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server"
                Width="260px" TargetControlID="CustomValidator3" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage=""
                Display="None" ControlToValidate="txt_終了年月日" SetFocusOnError="False" ClientValidationFunction="isDate"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="server"
                Width="240px" TargetControlID="RegularExpressionValidator2" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png">
            </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="CustomValidator1" ErrorMessage="" ControlToValidate="txt_終了年月日"
                ClientValidationFunction="checkDateIsValid" Display="None" SetFocusOnError="False"
                runat="server"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender35"
                Width="260px" TargetControlID="CustomValidator1" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <%--<asp:CustomValidator ID="CustomValidator4" ErrorMessage="" ControlToValidate="txt_終了年月日"
                ClientValidationFunction="checkDateIsNow" Display="None" SetFocusOnError="False"
                runat="server"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender9"
                TargetControlID="CustomValidator4" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />    --%>
        </div>
        <div class="detail-admin-row" style="display: none">
            <span class="detail-admin-label">企業分類コード :</span>
            <asp:DropDownList  ID="ddl_企業分類コード" runat="server" CssClass="dropdownlist width2" ValidationGroup="detailForm">
                <asp:ListItem Value="-1" Selected="true">-選択-</asp:ListItem>
                <asp:ListItem Value="1">企業</asp:ListItem>
                <asp:ListItem Value="2">派遣・前職</asp:ListItem>
                <asp:ListItem Value="3">送出し</asp:ListItem>
                <asp:ListItem Value="4">団体」</asp:ListItem>
            </asp:DropDownList>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">&nbsp;</span>
            <asp:Button ID="btn_登録" runat="server" Text="登録" CssClass="btn" OnClick="btn_登録_Click"
                OnClientClick="javascript:focusToControlErr();" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btn_リセット" runat="server" Text="リセット" CssClass="btn" CausesValidation="False"
                OnClick="btn_リセット_Click" />
        </div>
        <div class="headerLineAndGray">
            ＊会社履歴情報一覧</div>
        <div style="height: 30px">
        </div>
        <div class="detail-admin-row" style="margin: 10px 50px 50px 50px">
            <asp:GridView ID="grv" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"
                CellPadding="4" GridLines="Vertical" Height="40px" Width="100%" PageSize="10"
                AllowPaging="true" OnPageIndexChanging="grv_PageIndexChanging" OnRowCommand="grv_RowCommand"
                OnRowDataBound="grv_RowDataBound" OnPreRender="grv_PreRender">
                <Columns>
                    <%--<asp:HyperLinkField HeaderText="会社名" DataTextField="会社名" />--%>
                    <%--<asp:BoundField HeaderText="部門名" DataField="部門名" />--%>
                    <asp:TemplateField HeaderText="会社名" ItemStyle-Width="200px" ItemStyle-Wrap="true">
                        <ItemTemplate>
                            <div style="width: 200px; white-space: normal; overflow: hidden">
                                <asp:HyperLink ID="Label1" runat="server" ToolTip='<%# Bind("会社名")%>' Height="100%"><%#  ShowTextLength( Eval("会社名")) %></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="部門名">
                        <ItemStyle HorizontalAlign="Left" Width="200px" />
                        <ItemTemplate>
                            <div style="width: 200px; white-space: normal; overflow: hidden">
                                <asp:Label ID="Label1" runat="server" ToolTip='<%# Eval("部門名")%>'>  <%# ShowTextLength(Eval("部門名"))%> </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="開始年月日" DataField="開始年月日" DataFormatString="{0:yyyy年MM月dd日}" />
                    <asp:BoundField HeaderText="終了年月日" DataField="終了年月日" DataFormatString="{0:yyyy年MM月dd日}" />
                    <asp:ButtonField Text="Button" CommandName="Load" Visible="false" />
                </Columns>
            </asp:GridView>
        </div>
        <div class="detail-admin-row">
            <br />
            <div class="btn_back">
                <asp:Button ID="btn_戻る" runat="server" Text="←戻る" OnClick="btn_戻る_Click" CssClass="btn"
                    CausesValidation="False" />
            </div>
            <div class="btn_next btn_next_fixedforfrmJ_StaffEnterInpu ">
                <asp:Button ID="btn_次" runat="server" Text="次→" OnClick="btn_次_Click" CssClass="btn"
                    CausesValidation="False" />
            </div>
        </div>
    </div>
    <div>
        &nbsp;</div>
    <asp:HiddenField ID="hfNgaySinh" runat="server" />
    <br />
</asp:Content>
